package com.cyl.XmlDemo.service;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cyl.XmlDemo.dao.GroupDao;
import com.cyl.XmlDemo.entity.Group;
import com.cyl.XmlDemo.entity.GroupUser;

@Service
public class GroupServiceImpl implements GroupService {
	
	private final Logger log = LoggerFactory.getLogger(GroupServiceImpl.class);
	
	@Autowired
	private GroupDao groupDao;

	@Override
	public List<Group> getGroupByUid(int uid) {
		return groupDao.selectGroupByUid(uid);
	}
	
	@Override
	public boolean sendMsgToGroup() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean joinGroup(GroupUser groupUser) {
		//发送用户信息给群主
		return false;
	}

	@Override
	public boolean quitGroup(GroupUser groupUser) {
		groupDao.quitGroup(groupUser);
		return true;
	}


	@Override
	public boolean createGroup(Group group) {
		groupDao.createGroup(group);
		return true;
	}

	@Override
	public boolean addUserToGroup(GroupUser groupUser) {
		groupDao.addUserToGroup(groupUser);
		return true;
	}

}
